<?php

class m131009_121710_create_tbl_menu_data extends CDbMigration
{
	public function up()
	{
        $this->createTable('tbl_menu_data',array(
            'id'=>'pk',
            'entity_id'     =>'int(11) NOT NULL',
            'body_value'    =>'text',
            'body_format'   =>'string  NOT NULL',
            'create_time'    =>'datetime DEFAULT NULL',
            'update_time'   =>'datetime DEFAULT NULL',
        ), 'ENGINE=InnoDB');
        $this->addForeignKey('fk_menu_data','tbl_menu_data','entity_id','tbl_menu','id','CASCADE','RESTRICT');
	}

	public function down()
	{
        $this->dropForeignKey('fk_menu_data','tbl_menu_data');
		$this->dropTable('tbl_menu_data');
	}

	/*
	// Use safeUp/safeDown to do migration with transaction
	public function safeUp()
	{
	}

	public function safeDown()
	{
	}
	*/
}